package cc.surui.ui.fl 
{
	import flash.display.Sprite;
	
	/**
	 * ...
	 * @author Surui
	 */
	public class UIScore extends Sprite 
	{
		private var _digits:Object = {
			//0:new UILCDDigit(),
			//1:new UILCDDigit(),
			//2:new UILCDDigit(),
			//3:new UILCDDigit()
		}
		private var _gap:int = 27;
		public function UIScore( number:int ) 
		{
			for ( var i:int = 0; i < number; i++ ) {
				var _digit:UILCDDigit = new UILCDDigit();
				_digits[i] = _digit;
				this.addChild(_digit);
				_digit.x = _gap * ( number - i - 1 );
			}
			//this.addChild(_digits[3]);
			//this.addChild(_digits[2]);
			//_digits[2].x = 27;
			//this.addChild(_digits[1]);
			//_digits[1].x = 54;
			//this.addChild(_digits[0]);
			//_digits[0].x = 81;
		}
		
		public function set value( v:int ):void {
			var vString:String = String(v);
			var len:int = vString.length;
			for ( var i:int = 0; i < vString.length; i++ ) {
				_digits[i].value = int( vString.charAt( vString.length - 1 - i ) );
			}
		}
		
	}

}